import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooVueEditorPagesController } from '../../../controllers';
const uctoovueEditorPagesRouter = new Router();
const vueEditorPagesController = new uctooVueEditorPagesController();

uctoovueEditorPagesRouter.post('/add', requireUser, vueEditorPagesController.add);
uctoovueEditorPagesRouter.post('/edit', requireUser, rowLevelPermission('uctoo/vue_editor_pages'), vueEditorPagesController.edit);
uctoovueEditorPagesRouter.post('/del', requireUser, rowLevelPermission('uctoo/vue_editor_pages'), vueEditorPagesController.delete);

//For getting vueEditorPages with permission control
uctoovueEditorPagesRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/vue_editor_pages'), vueEditorPagesController.getSingle);
uctoovueEditorPagesRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/vue_editor_pages'), vueEditorPagesController.getMany);
uctoovueEditorPagesRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/vue_editor_pages'), vueEditorPagesController.getMany);

//#endregion AutoCreateCode
export default uctoovueEditorPagesRouter;
